<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"
		import="com.scalar.chiptrack.utils.ConfigManager,
        com.scalar.chiptrack.commons.Constants"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<chiptrack:checkLogon sourcePage="/jsp/operations/vendor_setup.jsp"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<script language="javascript">
//Added by Swadesh sahoo on 4th Jan 2004
function deleteCustomer()
{
        document.vendorForm.action.value = "DeleteVendor";
        document.vendorForm.submit();
}
//Added by Swadesh sahoo on 4th Jan 2004
function cancelPage()
{
        document.vendorForm.action.value = "SearchVendor";
        document.vendorForm.submit();
}

function openVendorContactPerson( type )
	{
		var vendorID = document.vendorForm['vendor.vendorId'].value;
		var contactPersonURL = '<%=chipTracContext%>/viewContactPerson.do?action=load&vendorId=' + vendorID + '&type='+ type;
        newWindow = window.open (contactPersonURL, 'optionsPopup', 'channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=900,height=450,resizable=yes');
	}

</script>

<!-- Top Header Start-->


<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->


<%@ include file="/jsp/operations/operations_menu.jsp" %>

	</TD>
<!-- end of the side navigations -->

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<!-- from here your body starts -->


<center><span class="NArialW">Vendor Setup</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

<html:form name="vendorForm" method="post" action="/vendor.do" type="com.scalar.chiptrack.operations.vendor.forms.VendorForm">

<nested:nest property="vendor">
<nested:hidden property="vendorId" />

<table border="0" width="90%" align=right>

<!--Sahoo on 4th of Jan 2004 to display Confirmation message and Confirm button  -->
 <tr><td colspan =7 align="left" class='NArialL'><font styleClass="NArialL" id="message" color="FF0000"  />&nbsp;</font></td></tr>

		<tr><td colspan =7 class="NArialL">
            <FONT color='FF0000'>
            <logic:present name="errorMsg">
                <bean:write name="errorMsg" />
            </logic:present>
            </FONT>
            <chiptrack:errors styleClass="NArialL" />
        </td></tr>

 <%!
     String VndId = null;
     String value = null;
 %>
<%
    value = (String)request.getAttribute("setConfirm");
    VndId = (String)request.getAttribute("VendorId");
        if( "Yes".equalsIgnoreCase(value) == true) {
        request.setAttribute("vendorId",VndId);
%>
<script language="javascript">
	var pa = document.getElementById("message");
 <%
	java.util.HashMap chkMap = null;
	if( request.getAttribute("error") != null  )
		chkMap = (java.util.HashMap)request.getAttribute("error");
	if( chkMap != null &&  chkMap.size() > 0 ) { %>


	var htmltext1  = "" ;
	htmltext1 =htmltext1+'<a href="javascript:cancelPage()"><img src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" border="0"></a>';
	pa.insertAdjacentHTML('BeforeEnd',htmltext1);

 <%
	 }
	 else
	 { %>
		var htmltext1  = "<li> Are you sure, you want to delete this Vendor Details ? ";
		htmltext1  = htmltext1 + '<a href="javascript:deleteCustomer();"><img src="<%=chipTracContext%>/jsp/includes/images/confirm.gif" border="0" onmouseover="window.status=\'Click to Confirm Remove Vendor\';return true" onmouseout="window.status=\'\';return true" title="Click here to Confirm Remove Vendor"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		htmltext1 =htmltext1+'<a href="javascript:cancelPage()"><img src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" border="0" onmouseover="window.status=\'Click to Cancel and go Back\';return true" onmouseout="window.status=\'\';return true" title="Click here to Cancel and go Back"></a>';
		pa.insertAdjacentHTML('BeforeEnd',htmltext1);

	<% }
 %>
</script>
<% } %>

<!-- Code ends here -->


 <tr>
   <td width="15%">
    <font class="NArialL" >Vendor Name</font>
   <td width= "20%">
	<font class="bodytext"><nested:write property="vendorName" scope="session" filter="true" /></font>
   </td>
   <td width="8%">&nbsp;</td>
    <td width="24%"><font class="NArialL" >Vendor Code</font></td>
    <td width="25%">
	<font class="bodytext"><nested:write property="vendorCode" scope="session" filter="true" /></font>
    </td>
  </tr>
  <tr>
    <td width="20%"><font class="NArialL" >Vendor #</font></td>
    <td width="20%">
	<font class="bodytext"><nested:write property="vendorNumber" scope="session" filter="true" /></font>
    </td>
    <td width="8%">&nbsp;</td>
    <td width="24%"><font class="NArialL" >Net Terms</font></td>
    <td width="25%">
	<font class="bodytext"><nested:write property="netTerms" scope="session" filter="true" /></font>
    </td>
  </tr>
  <tr>
    <td width="20%"><font class="NArialL" >Po Frequency</font></td>
    <td width="20%"><font class="bodytext">
    	<font class="bodytext"><nested:write property="poFrequency" scope="session" filter="true" /></font>
    </td>
    <td width="8%">&nbsp;</td>
    <td width="20%"><font class="NArialL" >Pay By Date</font></td>
    <td width="32%">
	<font class="bodytext"><nested:write property="payByDate" scope="session" filter="true" /></font>
    </td>
  </tr>
  <tr>
    <td width="20%"><font class="NArialL" >Shipper</font></td>
    <td width="20%"><font class="bodytext">
    	<font class="bodytext"><nested:write property="shipper" scope="session" filter="true" /></font>
    </td>
    <td width="8%">&nbsp;</td>
    <td width="20%">&nbsp;</td>
    <td width="32%">&nbsp;</td>
  </tr>

  <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
  <tr><td colspan=5 class="NArialL" valign="top">Comments:</td></tr>
  <tr>
      <td colspan=3 valign="top"><font class="bodytext"><nested:write property="comments" scope="session" filter="true" /></font></td>
      <td class="NArialL" valign="top">
          Alternate Vendor Names:
      </td>
      <td valign="top">
              <nested:present property="alternateVendorNames">
                  <table id="alternateVendorNameTable" cellSpacing=0 cellPadding=0>
                      <nested:iterate property="alternateVendorNames" id="alternateVendorName" indexId="idx" type="java.lang.String">
                           <tr><td nowrap class="bodytext"><%= new String( alternateVendorName.getBytes("ISO-8859-1"), "UTF-8")%></td></tr>
                      </nested:iterate>
                  </table>
              </nested:present>
      </td>
  </tr>
  <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>

  <tr>
    <td width="20%" height="23" bgcolor="#DEE1E2" colspan=5><font class="NArialL" >Sales Office Address:</font></td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Contact Person</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="salesContact" scope="session" filter="true" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Email</font>
    </td>
    <td width="32%" height="23">
    <nested:nest property="salesAddress">
	<font class="bodytext"><nested:write property="email" /></font>
    </td>
  </tr>
  <tr>
  <td width="30%" height="23"><font class="NArialL" ><a href="javascript:openVendorContactPerson('<%=Constants.VENDOR_SALES_LOCATION %>')" onMouseover="window.status='Click to View Vendor Contact Person';return true" onMouseout="window.status='';return true">
  View Contact Person</a></font></td>
  </tr>

  <tr>
    <td width="20%" height="23"><font class="NArialL" >Phone</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="phoneNumber" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Fax</font></td>
    <td width="32%" height="23">
	<font class="bodytext"><nested:write property="faxNumber" /></font>
    </td>
  </tr>
    <tr>
    <td width="20%" height="23"><font class="NArialL" >Cell Number :</font></td>
    <td width="20%" height="23">
		<font class="bodytext"><nested:write property="cellNumber"/></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >&nbsp;</font></td>
    <td width="32%" height="23">
  	&nbsp;
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Address 1</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="address1" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Address 2</font></td>
    <td width="32%" height="23">
	<font class="bodytext"><nested:write property="address2" /></font>
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Address 3</font></td>
    <td width="20%" height="23">
  	<font class="bodytext"><nested:write property="address3"/></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Address 4</font></td>
    <td width="32%" height="23">
  	<font class="bodytext"><nested:write property="address4"/></font>
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >City</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="city" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >State</font></td>
    <td width="32%" height="23">
	<font class="bodytext"><nested:write property="state" /></font>
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Zip</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="zipCode" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Country</font></td>
    <td width="32%" height="23">
	<font class="bodytext"><nested:write property="country" /></font>
    </td>
  </tr>

  </nested:nest>
  <% int i=1; %>
  <nested:iterate property="locationsList">
  <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
  <tr>
    <td height="23" colspan=5 bgcolor="#DEE1E2"><font class="NArialL" >Vendor Locations - <%=i++%>:</font></td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Contact Person</font></td>
    <td width="20%" height="23">
      	<font class="bodytext"><nested:write property="contactPerson" /></font>
    </td>
    <nested:nest property="locationAddress">
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Email</font></td>
    <td width="32%" height="23">
 	<font class="bodytext"><nested:write property="email" /></font>
    </td>
  </tr>
   <tr>
  <td width="30%" height="23"><font class="NArialL" ><a href="javascript:openVendorContactPerson('<%=Constants.VENDOR_SHIPPING_LOCATION %>')" onMouseover="window.status='Click to View Vendor Contact Person';return true" onMouseout="window.status='';return true">
  View Contact Person</a></font></td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Phone</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="phoneNumber" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Fax</font></td>
    <td width="32%" height="23">
	<font class="bodytext"><nested:write property="faxNumber" /></font>
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Cell Number :</font></td>
    <td width="20%" height="23">
		<font class="bodytext"><nested:write property="cellNumber"/></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >&nbsp;</font></td>
    <td width="32%" height="23">
  	&nbsp;
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Address 1</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="address1" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Address 2</font></td>
    <td width="32%" height="23">
	<font class="bodytext"><nested:write property="address2" /></font>
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Address 3</font></td>
    <td width="20%" height="23">
  		<font class="bodytext"><nested:write property="address3"/></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Address 4</font></td>
    <td width="32%" height="23">
	  	<font class="bodytext"><nested:write property="address4"/></font>
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >City</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="city" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >State</font></td>
    <td width="32%" height="23">
	<font class="bodytext"><nested:write property="state" /></font>
    </td>
  </tr>
  <tr>
    <td width="20%" height="23"><font class="NArialL" >Zip</font></td>
    <td width="20%" height="23">
	<font class="bodytext"><nested:write property="zipCode" /></font>
    </td>
    <td width="8%" height="23"></td>
    <td width="20%" height="23"><font class="NArialL" >Country</font></td>
    <td width="32%" height="23">
	<font class="bodytext"><nested:write property="country" /></font>
    </td>
  </tr>
  <tr>
    <td colspan=5>
  	 <logic:iterate name="vendorForm" id="locationTypes" property="locationTypes">
  	 	<font class="NArialL">
           <!-- modified by Swadesh sahoo on 5th feb 2004 -->
  	 	<nested:multibox property="selectedLocationTypes" styleClass="txFiled" disabled="true" >
  	 		<bean:write name="locationTypes" />
  	 	</nested:multibox>
  	 	<bean:write name="locationTypes" />
  	 	</font>
  	 </logic:iterate>
     </td>
  </tr>
    </nested:nest>

  </nested:iterate>

</table>

</nested:nest>
  <input type="hidden" name="action" value="">
  <!-- Added by Swadesh Sahoo -->
  <input type="hidden" name="vendorID" value="<%=VndId%>">

</html:form>


<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>


<!-- footer end here -->

</BODY>
</HTML>